<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-goods_name" data-rule="required" class="form-control form-control" name="row[goods_name]" type="text" value="{$row.goods_name}">
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Introduce')}:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-introduce" data-rule="required" class="form-control form-control" name="row[introduce]" type="text" value="{$row.introduce}">
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">编码:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-bianma"  class="form-control form-control" name="row[bianma]" type="text" value="{$row.bianma}">
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">单个重量:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-zhongliang"  class="form-control form-control" name="row[zhongliang]" type="number" step="0.01" value="{$row.zhongliang}">
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">运费模板ID:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-litestore_freight_id" data-rule="required" data-source="litestorefreight/index" class="form-control selectpage form-control" name="row[litestore_freight_id]" type="text" value="{$row.litestore_freight_id}">
    </div>
</div>

<div class="form-group">
    <label for="c-pid" class="control-label col-xs-12 col-sm-2">分类:</label>
    <div class="col-xs-12 col-sm-8">
        <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[pid]">
            {foreach name="parentList" item="vo"}
                <option data-type="{$vo.type}" value="{$key}" {in name="key" value="$row.pid"}selected{/in}>{$vo.name}</option>
                {/foreach}
        </select>
    </div>
</div>

  
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">封面图片(单选):</label>
    <div class="col-xs-12 col-sm-8">
        <div class="input-group">
            <input id="c-cover" data-rule="required" class="form-control" size="50" name="row[cover]" type="text" value="{$row.cover}">
            <div class="input-group-addon no-border no-padding">
                <span><button type="button" id="plupload-cover" class="btn btn-danger plupload" data-input-id="c-cover" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-cover"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-cover" class="btn btn-primary fachoose" data-input-id="c-cover" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            </div>
            <span class="msg-box n-right" for="c-cover"></span>
        </div>
        <ul class="row list-inline plupload-preview" id="p-cover"></ul>
    </div>
</div>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">banner图片(可多选):</label>
    <div class="col-xs-12 col-sm-8">
        <div class="input-group">
            <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text" value="{$row.images}">
            <div class="input-group-addon no-border no-padding">
                <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            </div>
            <span class="msg-box n-right" for="c-images"></span>
        </div>
        <ul class="row list-inline plupload-preview" id="p-images"></ul>
    </div>
</div>

    <div class="form-group" id="types">
        <label class="control-label col-xs-12 col-sm-2">{:__('Spec_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-spec_type" data-rule="required" class="form-control selectpicker" name="row[spec_type]">
                {foreach name="specTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.spec_type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <!-- 商品规格属性 start -->
    <div class="goods-spec-many form-group" style="display: <?= $row['spec_type'] === '20' ? 'block' : 'none' ?>;" >

        <div class="goods-spec-box col-xs-12 col-sm-11" style="background-color: white;">
            <!-- 规格属性 -->
            <div class="spec-attr"></div>
           <!-- 分割线 -->
          <div style="border: 1px dashed #e3e2e5;margin-bottom: 2.4rem;margin-top: 2.4rem;"></div>
            <!-- 添加规格：按钮 -->
            <div class="spec-group-button">
              <button type="button" class="btn-addSpecGroup btn btn-xs btn-success"><i class="fa fa-plus"></i>&nbsp;&nbsp;&nbsp;添加规格</button>
            </div>

            <!-- 添加规格：表单 -->
            <div class="spec-group-add">
                <div class="spec-group-add-item form-group">
                    <label class="control-label form-require">规格名 </label>
                    <input type="text" class="input-specName tpl-form-input"
                           placeholder="请输入规格名称">
                </div>
                <div class="spec-group-add-item form-group">
                    <label class="control-label form-require">规格值 </label>
                    <input type="text" class="input-specValue tpl-form-input"
                           placeholder="请输入规格值">
                    <input type="hidden" class="input-specGoodsid tpl-form-input" value="{$row['goods_id']}">
                </div>
               
                <div class="spec-group-add-item margin-top">
                    <button type="button" class="btn-addSpecName btn btn-xs btn-success"> 确定
                    </button>
                    <button type="button" class="btn-cancleAddSpecName btn btn-xs btn-default"> 取消
                    </button>
                </div>
            </div>
          
          <!-- 分割线 -->
          <div style="border: 1px dashed #e3e2e5;margin-bottom: 2.4rem;margin-top: 2.4rem;"></div>
          <!-- 添加平时价格：按钮 -->
            <div class="free-time-button" style="margin-top: 10px;">
            </div>
            <!-- 商品多规格sku信息 -->
            <div class="goods-sku scrollable-horizontal">
                <!-- 分割线 -->
                <div class="goods-spec-line"></div>
                <!-- sku 批量设置 -->
                <div class="spec-batch form-inline">
                    <div class="form-group">
                        <label class="control-label">批量设置</label>
                    </div>
                    <!-- <div class="form-group">
                        <input type="text" data-type="goods_no" placeholder="商品编码">
                    </div> -->
                    <div class="form-group">
                        <input type="number" data-type="goods_price" placeholder="销售价">
                    </div>
                   <!--  <div class="form-group">
                        <input type="number" data-type="line_price" placeholder="划线价">
                    </div> -->
                    <div class="form-group">
                        <input type="number" data-type="stock_num" placeholder="库存数量">
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn-specBatchBtn btn btn-sm btn-secondary
                         radius">确定
                        </button>
                    </div>
                </div>
                <!-- sku table -->
                <table class="spec-sku-tabel table table-bordered table-centered margin-bottom-xs text-nowrap"></table>
            </div>
        </div>
    </div>
    <div class="goods-spec-single" style="display: <?= $row['spec_type'] === '10' ? 'block' : 'none' ?>;"> 
       
    </div>
    <!-- 商品规格属性 end -->

    <div class="form-group" id="contents">
        <label class="control-label col-xs-12 col-sm-2" >{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control editor form-control" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

{include file="litestore_goods/spec_many_template" /}

<link rel="stylesheet" href="__CDN__/assets/addons/litestore/css/litestoregoods.css">
<script type="text/javascript">
    var from_specData = <?= $row['specData'] ?>;
</script>